<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>Insert title here</title>
		<style type="text/css">
			*{
				border:1px solid red;
			}
		</style>
		<script type="text/javascript">
			function myfn() {
				var obj = event.target||event.srcElement;
				//输出点击元素名称
				alert(obj.nodeName);
			}
		</script>
	</head>
		<body>
			<div onclick="myfn()">
				<p>
					<input type = "button" value="按钮" >
				</p>
			</div>
		</body>
</html>